using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialStatisticsTools._MappingClusters
{
    /// <summary>
    /// <para>Optimized Hot Spot Analysis</para>
    /// <para>Given incident points or weighted features (points or polygons), creates a map of statistically significant hot and cold spots using the Getis-Ord Gi* statistic. It evaluates the characteristics of the input feature class to produce optimal results.</para>
    /// <para>给定入射点或加权要素（点或面），使用 Getis-Ord Gi* 统计量创建具有统计显著性的热点和冷点地图。它评估输入要素类的特征以生成最佳结果。</para>
    /// </summary>    
    [DisplayName("Optimized Hot Spot Analysis")]
    public class OptimizedHotSpotAnalysis : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public OptimizedHotSpotAnalysis()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Features">
        /// <para>Input Features</para>
        /// <para>The point or polygon feature class for which hot spot analysis will be performed.</para>
        /// <para>将对其执行热点分析的点要素类或面要素类。</para>
        /// </param>
        /// <param name="_Output_Features">
        /// <para>Output Features</para>
        /// <para>The output feature class to receive the z-score, p-value, and Gi_Bin results.</para>
        /// <para>用于接收 z 分数、p 值和 Gi_Bin 结果的输出要素类。</para>
        /// </param>
        public OptimizedHotSpotAnalysis(object _Input_Features, object _Output_Features)
        {
            this._Input_Features = _Input_Features;
            this._Output_Features = _Output_Features;
        }
        public override string ToolboxName => "Spatial Statistics Tools";

        public override string ToolName => "Optimized Hot Spot Analysis";

        public override string CallName => "stats.OptimizedHotSpotAnalysis";

        public override List<string> AcceptEnvironments => ["MResolution", "MTolerance", "XYResolution", "XYTolerance", "ZResolution", "ZTolerance", "geographicTransformations", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "qualifiedFieldNames", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Features, _Output_Features, _Analysis_Field, _Incident_Data_Aggregation_Method.GetGPValue(), _Bounding_Polygons_Defining_Where_Incidents_Are_Possible, _Polygons_For_Aggregating_Incidents_Into_Counts, _Density_Surface, _Cell_Size, _Distance_Band];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The point or polygon feature class for which hot spot analysis will be performed.</para>
        /// <para>将对其执行热点分析的点要素类或面要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Input_Features { get; set; }


        /// <summary>
        /// <para>Output Features</para>
        /// <para>The output feature class to receive the z-score, p-value, and Gi_Bin results.</para>
        /// <para>用于接收 z 分数、p 值和 Gi_Bin 结果的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _Output_Features { get; set; }


        /// <summary>
        /// <para>Analysis Field</para>
        /// <para>The numeric field (number of incidents, crime rates, test scores, and so on) to be evaluated.</para>
        /// <para>要评估的数值字段（事件数、犯罪率、考试成绩等）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Analysis Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Analysis_Field { get; set; } = null;


        /// <summary>
        /// <para>Incident Data Aggregation Method</para>
        /// <para><xdoc>
        ///   <para>The aggregation method to use to create weighted features for analysis from incident point data.</para>
        ///   <bulletList>
        ///     <bullet_item>Count incidents within fishnet grid—A fishnet polygon mesh will overlay the incident point data and the number of incidents within each polygon cell will be counted. If no bounding polygon is provided in the Bounding Polygons Defining Where Incidents Are Possible parameter, only cells with at least one incident will be used in the analysis; otherwise, all cells within the bounding polygons will be analyzed.</bullet_item><para/>
        ///     <bullet_item>Count incidents within hexagon grid—A hexagon polygon mesh will overlay the incident point data and the number of incidents within each polygon cell will be counted. If no bounding polygon is provided in the Bounding Polygons Defining Where Incidents Are Possible parameter, only cells with at least one incident will be used in the analysis; otherwise, all cells within the bounding polygons will be analyzed.</bullet_item><para/>
        ///     <bullet_item>Count incidents within aggregation polygons—You provide aggregation polygons to overlay the incident point data in the Polygons For Aggregating Incidents Into Counts parameter. The incidents within each polygon are counted.</bullet_item><para/>
        ///     <bullet_item>Snap nearby incidents to create weighted points—Nearby incidents will be aggregated together to create a single weighted point. The weight for each point is the number of aggregated incidents at that location.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于创建加权要素以根据事件点数据进行分析的聚合方法。</para>
        ///   <bulletList>
        ///     <bullet_item>计算渔网网格内的事件 - 渔网面网格将叠加事件点数据，并计算每个面像元内的事件数。如果定义事件可能位置的边界多边形参数中未提供边界多边形，则分析中将仅使用至少一个事件的像元;否则，将分析边界多边形内的所有像元。</bullet_item><para/>
        ///     <bullet_item>对六边形网格内的事件进行计数 - 六边形面网格将叠加事件点数据，并计算每个面像元内的事件数。如果定义事件可能位置的边界多边形参数中未提供边界多边形，则分析中将仅使用至少一个事件的像元;否则，将分析边界多边形内的所有像元。</bullet_item><para/>
        ///     <bullet_item>在聚合面内对事件进行计数 - 在用于将事件聚合到计数参数的面参数中提供聚合面以叠加事件点数据。对每个面内的事件进行计数。</bullet_item><para/>
        ///     <bullet_item>捕捉附近事件以创建加权点 - 附近事件将聚合在一起以创建单个加权点。每个点的权重是该位置的聚合事件数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Incident Data Aggregation Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Incident_Data_Aggregation_Method_value _Incident_Data_Aggregation_Method { get; set; } = _Incident_Data_Aggregation_Method_value._COUNT_INCIDENTS_WITHIN_FISHNET_POLYGONS;

        public enum _Incident_Data_Aggregation_Method_value
        {
            /// <summary>
            /// <para>Count incidents within fishnet grid</para>
            /// <para>Count incidents within fishnet grid—A fishnet polygon mesh will overlay the incident point data and the number of incidents within each polygon cell will be counted. If no bounding polygon is provided in the Bounding Polygons Defining Where Incidents Are Possible parameter, only cells with at least one incident will be used in the analysis; otherwise, all cells within the bounding polygons will be analyzed.</para>
            /// <para>计算渔网网格内的事件 - 渔网面网格将叠加事件点数据，并计算每个面像元内的事件数。如果定义事件可能位置的边界多边形参数中未提供边界多边形，则分析中将仅使用至少一个事件的像元;否则，将分析边界多边形内的所有像元。</para>
            /// </summary>
            [Description("Count incidents within fishnet grid")]
            [GPEnumValue("COUNT_INCIDENTS_WITHIN_FISHNET_POLYGONS")]
            _COUNT_INCIDENTS_WITHIN_FISHNET_POLYGONS,

            /// <summary>
            /// <para>Count incidents within hexagon grid</para>
            /// <para>Count incidents within hexagon grid—A hexagon polygon mesh will overlay the incident point data and the number of incidents within each polygon cell will be counted. If no bounding polygon is provided in the Bounding Polygons Defining Where Incidents Are Possible parameter, only cells with at least one incident will be used in the analysis; otherwise, all cells within the bounding polygons will be analyzed.</para>
            /// <para>对六边形网格内的事件进行计数 - 六边形面网格将叠加事件点数据，并计算每个面像元内的事件数。如果定义事件可能位置的边界多边形参数中未提供边界多边形，则分析中将仅使用至少一个事件的像元;否则，将分析边界多边形内的所有像元。</para>
            /// </summary>
            [Description("Count incidents within hexagon grid")]
            [GPEnumValue("COUNT_INCIDENTS_WITHIN_HEXAGON_POLYGONS")]
            _COUNT_INCIDENTS_WITHIN_HEXAGON_POLYGONS,

            /// <summary>
            /// <para>Count incidents within aggregation polygons</para>
            /// <para>Count incidents within aggregation polygons—You provide aggregation polygons to overlay the incident point data in the Polygons For Aggregating Incidents Into Counts parameter. The incidents within each polygon are counted.</para>
            /// <para>在聚合面内对事件进行计数 - 在用于将事件聚合到计数参数的面参数中提供聚合面以叠加事件点数据。对每个面内的事件进行计数。</para>
            /// </summary>
            [Description("Count incidents within aggregation polygons")]
            [GPEnumValue("COUNT_INCIDENTS_WITHIN_AGGREGATION_POLYGONS")]
            _COUNT_INCIDENTS_WITHIN_AGGREGATION_POLYGONS,

            /// <summary>
            /// <para>Snap nearby incidents to create weighted points</para>
            /// <para>Snap nearby incidents to create weighted points—Nearby incidents will be aggregated together to create a single weighted point. The weight for each point is the number of aggregated incidents at that location.</para>
            /// <para>捕捉附近事件以创建加权点 - 附近事件将聚合在一起以创建单个加权点。每个点的权重是该位置的聚合事件数。</para>
            /// </summary>
            [Description("Snap nearby incidents to create weighted points")]
            [GPEnumValue("SNAP_NEARBY_INCIDENTS_TO_CREATE_WEIGHTED_POINTS")]
            _SNAP_NEARBY_INCIDENTS_TO_CREATE_WEIGHTED_POINTS,

        }

        /// <summary>
        /// <para>Bounding Polygons Defining Where Incidents Are Possible</para>
        /// <para>A polygon feature class defining where the incident Input Features could possibly occur.</para>
        /// <para>一个面要素类，用于定义可能发生入射输入要素的位置。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Bounding Polygons Defining Where Incidents Are Possible")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Bounding_Polygons_Defining_Where_Incidents_Are_Possible { get; set; } = null;


        /// <summary>
        /// <para>Polygons For Aggregating Incidents Into Counts</para>
        /// <para>The polygons to use to aggregate the incident Input Features in order to get an incident count for each polygon feature.</para>
        /// <para>用于聚合事件输入要素以获取每个面要素的事件计数的面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Polygons For Aggregating Incidents Into Counts")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Polygons_For_Aggregating_Incidents_Into_Counts { get; set; } = null;


        /// <summary>
        /// <para>Density Surface</para>
        /// <para>The Density Surface parameter is disabled; it remains as a tool parameter only to support backwards compatibility. The Kernel Density tool can be used if you would like a density surface visualization of your weighted points.</para>
        /// <para>“密度表面”（Density Surface） 参数处于禁用状态;它仅作为工具参数保留，以支持向后兼容性。如果您想要加权点的密度表面可视化，可以使用核密度工具。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Density Surface")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _Density_Surface { get; set; } = null;


        /// <summary>
        /// <para>Cell Size</para>
        /// <para>The size of the grid cells used to aggregate the Input Features. When aggregating into a hexagon grid, this distance is used as the height to construct the hexagon polygons.</para>
        /// <para>用于聚合输入要素的格网像元的大小。聚合到六边形网格中时，此距离用作构造六边形多边形的高度。</para>
        /// <para>单位： Feet | Meters | Kilometers | Miles </para>
        /// </summary>
        [DisplayName("Cell Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _Cell_Size { get; set; } = null;


        /// <summary>
        /// <para>Distance Band</para>
        /// <para>The spatial extent of the analysis neighborhood. This value determines which features are analyzed together in order to assess local clustering.</para>
        /// <para>分析邻域的空间范围。此值确定要一起分析哪些要素以评估局部聚类。</para>
        /// <para>单位： Feet | Meters | Kilometers | Miles </para>
        /// </summary>
        [DisplayName("Distance Band")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _Distance_Band { get; set; } = null;


        public OptimizedHotSpotAnalysis SetEnv(object MResolution = null, object MTolerance = null, object XYResolution = null, object XYTolerance = null, object ZResolution = null, object ZTolerance = null, object geographicTransformations = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, bool? qualifiedFieldNames = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MResolution: MResolution, MTolerance: MTolerance, XYResolution: XYResolution, XYTolerance: XYTolerance, ZResolution: ZResolution, ZTolerance: ZTolerance, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, qualifiedFieldNames: qualifiedFieldNames, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}